package cn.cpf.app.gobang.frame;

import cn.cpf.app.gobang.global.Config;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;

public class GobangFrame extends JFrame {

	private static final long serialVersionUID = 1L;

	private final JPanel goBangPanel;

	/**
	 * Create the cn.cpf.app.gobang.frame.
	 */
	public GobangFrame() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		JMenuBar menuBar = new MainMenuBar();
		setJMenuBar(menuBar);
		
		setBounds(100, 100, (Config.BOARD_LENGTH * Config.PIECE_WIDTH + 16)*2, Config.BOARD_LENGTH * Config.PIECE_WIDTH + 39 + 24);
		
		goBangPanel = new GoBangPanel();
		goBangPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		goBangPanel.setLayout(new BorderLayout(0, 0));
		setContentPane(goBangPanel);
	}

	public GoBangPanel getGoBangPanel() {
		return (GoBangPanel) this.goBangPanel;
	}
	
}
